<?php

declare(strict_types=1);
/**
 * This file is part of bearing-web.
 *
 * @link     https://www.bearing.cn/
 * @contact  tech@bearing.cn
 * @license  https://gitee.com/cppo/bearing_web/-/blob/master/README.md
 */
$host = env('DB_HOST');
$port = env('DB_PORT');
$dbname = env('DB_NAME');
$username = env('DB_USER');
$password = env('DB_PASS');
$prefix = env('DB_PREFIX');
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=' . $host . ';port=' . $port . ';dbname=' . $dbname,
    'username' => $username,
    'password' => $password,
    'charset' => 'utf8mb4',
    'tablePrefix' => $prefix,

    // Schema cache options (for production environment)
    'enableSchemaCache' => YII_ENV_PROD,
    'schemaCacheDuration' => 300,
    'schemaCache' => 'cache',
];
